<template>
    <div>
        <button @click="showTip">{{ count }}</button>
    </div>
</template>

<script>
    export default{
        props: [
            "interval",
            "timerId"
        ],
        data() {
            return {
                count:100,
                intervalId:''
            }
        },
        methods: {
            showTip() {
                this.$emit('show','tigger emit')
            },
            showData() {
                alert('被父组件调用')
            }
        },
        mounted() {
            console.log(this.interval)
            this.intervalId = setInterval(() => {
                this.count--;
            },1000)

            //props传递过来的值不允许修改
            //this.interval = 20
        }
    }
</script>

<style scoped>

</style>